import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:leader_doctor_flutter/styles/colors.dart';

class CustomButtonWidget extends StatelessWidget {
  final String text;
  final VoidCallback? onTap;
  final TextStyle? textStyle;
  final BoxDecoration? decoration;

  const CustomButtonWidget({
    Key? key,
    required this.text,
    this.onTap,
    this.textStyle,
    this.decoration,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: onTap,
      child: Container(
        height: 40.w,
        alignment: Alignment.center,
        decoration: decoration ??
            BoxDecoration(
              borderRadius: BorderRadius.circular(6.w),
              color: ColorRes.colorMain,
            ),
        child: Text(
          text,
          style: textStyle ?? TextStyle(fontSize: 14.sp, color: ColorRes.white),
        ),
      ),
    );
  }
}
